package com.wmh.baseservice.merchant.pojo;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;

/**
 * @author wmh generator
 * @since 2022-04-25
 */
@ApiModel(value="MerchantInfo对象", description="商家信息表")
public class MerchantInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "状态:	0正常 1冻结")
    private Integer status;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "版本号")
    @Version
    private Integer version;

    private Date createTime;

    private Date updateTime;

    @ApiModelProperty(value = "账号名")
    private String account;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "角色id")
    private Long roleId;

    @ApiModelProperty(value = "盐值")
    private String salt;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "手机号")
    private String phone;

    @ApiModelProperty(value = "用户id")
    private Long usId;

    @ApiModelProperty(value = "父id -1为顶级 ")
    private Long parentId;

    @ApiModelProperty(value = "股份占比 1为100%")
    private Double shares;

    @ApiModelProperty(value = "商家余额")
    private BigDecimal balance;

    @ApiModelProperty(value = "店铺头像（主商家可调，子商家不可设置）")
    private String storeAvatar;

    @ApiModelProperty(value = "店铺名称（主商家可调，子商家不可设置）")
    private String storeName;

    @ApiModelProperty(value = "1入驻生成 2租赁生成")
    private Integer type;

    @ApiModelProperty(value = "缴纳保证金金额（主商家缴纳即可）")
    private BigDecimal margin;

    @TableField(exist = false)
    private String nick;

    @TableField(exist = false)
    private String avatar;

    public String getNick() {
        return nick;
    }

    public void setNick(String nick) {
        this.nick = nick;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }
    public Long getId() {
        return id;
    }

    public MerchantInfo setId(Long id) {
        this.id = id;
        return this;
    }
    public Integer getStatus() {
        return status;
    }

    public MerchantInfo setStatus(Integer status) {
        this.status = status;
        return this;
    }
    public String getRemark() {
        return remark;
    }

    public MerchantInfo setRemark(String remark) {
        this.remark = remark;
        return this;
    }
    public Integer getVersion() {
        return version;
    }

    public MerchantInfo setVersion(Integer version) {
        this.version = version;
        return this;
    }
    public Date getCreateTime() {
        return createTime;
    }

    public MerchantInfo setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }
    public Date getUpdateTime() {
        return updateTime;
    }

    public MerchantInfo setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        return this;
    }
    public String getAccount() {
        return account;
    }

    public MerchantInfo setAccount(String account) {
        this.account = account;
        return this;
    }
    public String getPassword() {
        return password;
    }

    public MerchantInfo setPassword(String password) {
        this.password = password;
        return this;
    }
    public Long getRoleId() {
        return roleId;
    }

    public MerchantInfo setRoleId(Long roleId) {
        this.roleId = roleId;
        return this;
    }
    public String getSalt() {
        return salt;
    }

    public MerchantInfo setSalt(String salt) {
        this.salt = salt;
        return this;
    }
    public String getName() {
        return name;
    }

    public MerchantInfo setName(String name) {
        this.name = name;
        return this;
    }
    public String getPhone() {
        return phone;
    }

    public MerchantInfo setPhone(String phone) {
        this.phone = phone;
        return this;
    }
    public Long getUsId() {
        return usId;
    }

    public MerchantInfo setUsId(Long usId) {
        this.usId = usId;
        return this;
    }
    public Long getParentId() {
        return parentId;
    }

    public MerchantInfo setParentId(Long parentId) {
        this.parentId = parentId;
        return this;
    }
    public Double getShares() {
        return shares;
    }

    public MerchantInfo setShares(Double shares) {
        this.shares = shares;
        return this;
    }
    public BigDecimal getBalance() {
        return balance;
    }

    public MerchantInfo setBalance(BigDecimal balance) {
        this.balance = balance;
        return this;
    }
    public String getStoreAvatar() {
        return storeAvatar;
    }

    public MerchantInfo setStoreAvatar(String storeAvatar) {
        this.storeAvatar = storeAvatar;
        return this;
    }
    public String getStoreName() {
        return storeName;
    }

    public MerchantInfo setStoreName(String storeName) {
        this.storeName = storeName;
        return this;
    }
    public Integer getType() {
        return type;
    }

    public MerchantInfo setType(Integer type) {
        this.type = type;
        return this;
    }
    public BigDecimal getMargin() {
        return margin;
    }

    public MerchantInfo setMargin(BigDecimal margin) {
        this.margin = margin;
        return this;
    }

    public static final String ID = "id";

    public static final String STATUS = "status";

    public static final String REMARK = "remark";

    public static final String VERSION = "version";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

    public static final String ACCOUNT = "account";

    public static final String PASSWORD = "password";

    public static final String ROLE_ID = "role_id";

    public static final String SALT = "salt";

    public static final String NAME = "name";

    public static final String PHONE = "phone";

    public static final String US_ID = "us_id";

    public static final String PARENT_ID = "parent_id";

    public static final String SHARES = "shares";

    public static final String BALANCE = "balance";

    public static final String STORE_AVATAR = "store_avatar";

    public static final String STORE_NAME = "store_name";

    public static final String TYPE = "type";

    public static final String MARGIN = "margin";

    @Override
    public String toString() {
        return "MerchantInfo{" +
            "id=" + id +
            ", status=" + status +
            ", remark=" + remark +
            ", version=" + version +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
            ", account=" + account +
            ", password=" + password +
            ", roleId=" + roleId +
            ", salt=" + salt +
            ", name=" + name +
            ", phone=" + phone +
            ", usId=" + usId +
            ", parentId=" + parentId +
            ", shares=" + shares +
            ", balance=" + balance +
            ", storeAvatar=" + storeAvatar +
            ", storeName=" + storeName +
            ", type=" + type +
            ", margin=" + margin +
        "}";
    }

    public final static String[] getFields(String ...noField){
        List<String> list = new ArrayList<>(Arrays.asList(
            MerchantInfo.ID
            ,MerchantInfo.STATUS
            ,MerchantInfo.REMARK
            ,MerchantInfo.VERSION
            ,MerchantInfo.CREATE_TIME
            ,MerchantInfo.UPDATE_TIME
            ,MerchantInfo.ACCOUNT
            ,MerchantInfo.PASSWORD
            ,MerchantInfo.ROLE_ID
            ,MerchantInfo.SALT
            ,MerchantInfo.NAME
            ,MerchantInfo.PHONE
            ,MerchantInfo.US_ID
            ,MerchantInfo.PARENT_ID
            ,MerchantInfo.SHARES
            ,MerchantInfo.BALANCE
            ,MerchantInfo.STORE_AVATAR
            ,MerchantInfo.STORE_NAME
            ,MerchantInfo.TYPE
            ,MerchantInfo.MARGIN
        ));
        list.removeAll(new ArrayList<>(Arrays.asList(noField)));
        return list.toArray(new String[0]);
    }
}